#version 330 core

layout(location = 0) in vec3 apos;
layout(location = 1) in vec3 anormal;

uniform mat4 projMat;
uniform mat4 modelMat;
uniform mat4 viewMat;

out vec3 fragPos;
out vec3 normal;

void main() 
{
   gl_Position = projMat * viewMat * modelMat * vec4(apos, 1.0f);
   fragPos = (modelMat * vec4(apos, 1.0f)).xyz;
   normal = mat3(transpose(inverse(modelMat))) * anormal;
}